<?php
    $sql = "SELECT td_id,td_value FROM text_data WHERE td_id=35";
    $result = $db->Execute($sql);
    
    $SITEURL = $iniVars['Locations']['siteurl'];
    $SITEPATH = $iniVars['Locations']['sitepath'];
    
    while (!$result->EOF)
    {
        $data[$result->fields['td_id']] = $result->fields['td_value'];
        $result->MoveNext();
    }
    
    $result->Close();
?>

<script type="text/javascript">
    $(document).ready(function(){
        
        $("#tabs").tabs();
        
        $('.submitBt').click(function(){
            $('.submit_indicator').css('display','inline');
            var data = $("#tiTopMsgFrm").serialize();
            $.post('function/feedback.php',data,function(data){
                $('.submit_indicator').css('display','none');
                if(trim(data)=='success')
                {
                    $("#success_msg").html('บันทึกข้อมูลเรียบร้อยแล้ว');
                    $("#success_msg").show('highlight',3000,function(){
                        $("#success_msg").hide('highlight',3000);
                    });
                }
                else
                {
                    $("#error_msg").html(data);
                    $("#error_msg").show('highlight',3000,function(){
                        $("#error_msg").hide('highlight',3000);
                    });
                }
            });
        });
    });
</script>

<h3 class="pageTitle">แนะนำ ติชม</h3>

<div id="tabs" class="courseEdit">
    
    <ul>
        <li id="car_"><a href="#tabs-1" title="Add files">ข้อมูลติดต่อหน้าแนะนำติชม</a></li>
    </ul>
    
    <form name="tiTopMsgFrm" id="tiTopMsgFrm">
        <div id="tabs-1" class="tiTopMsgFrm">
            <p>
                <label>E-mail :</label>
                <input type="text" style="width:50%;" name="email" class="text_input" value="<?php echo $data['35']; ?>" />
            </p>
        </div>
    </form>
</div>

<form>
    <input type="button" class="button submitBt" value="Submit" />
    &nbsp;<img src="images/ajax-loader.gif" class="ajax_load_img submit_indicator"/>
</form>
<div class="fail canhide png_bg ajax_msg" id="error_msg"></div>
<div class="success canhide ajax_msg" id="success_msg"></div>